import request from '@/utils/request'

// 查询机井故障表列表
export function listFault(query) {
  return request({
    url: '/farmwell/fault/list',
    method: 'get',
    params: query
  })
}

// 查询机井故障表详细
export function getFault(id) {
  return request({
    url: '/farmwell/fault/' + id,
    method: 'get'
  })
}
// 根据机井id查询机井故障表
export function queryByIsFault(id) {
  return request({
    url: '/farmwell/fault/queryByIsFault/' + id,
    method: 'get'
  })
}
// 查询机井信息二维码
export function getQrText(code) {
  return request({
    url: '/farmwell/fault/getQR/' + code,
    method: 'get'
  })
}
// 新增机井故障表
export function addFault(data) {
  return request({
    url: '/farmwell/fault',
    method: 'post',
    data: data
  })
}

// 修改机井故障表
export function updateFault(data) {
  return request({
    url: '/farmwell/fault',
    method: 'put',
    data: data
  })
}

// 删除机井故障表
export function delFault(id) {
  return request({
    url: '/farmwell/fault/' + id,
    method: 'delete'
  })
}
